package com.PVZ.model.zombie;

import com.PVZ.model.Anime;
import com.PVZ.model.emuns.AnimeType;
import com.PVZ.model.emuns.Configs;
import com.PVZ.model.emuns.MoveType;
import com.PVZ.model.emuns.ZombieType;
import com.PVZ.utils.Util;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by @Author: kabuda on @Date: 2021/5/28 8:57
 */
@Getter
@Setter
public class NormalZombie extends Zombie {

    public NormalZombie(int row,int col,MoveType moveType){
        super(ZombieType.NormalZombie,row,col,-70,-50,1);
        this.setMoveType(moveType);
        this.setHealth(Configs.zombieHealth.get(ZombieType.NormalZombie));
        this.setBoxPadding(-20,-20 , -20, -20);
        setAnime();
    }
    public  NormalZombie(){
        super(ZombieType.NormalZombie);
        this.setHealth(Configs.zombieHealth.get(ZombieType.NormalZombie));
        this.setImgSrc("res/img/zombiePng/NormalZombie/move/Move-0.png");
        setAnime();
    }

    @Override
    public void setAnime() {
        Map<AnimeType, Anime>animeMap=new HashMap<>();


        animeMap.put(AnimeType.MOVE, getNormalZombie());
        animeMap.put(AnimeType.BREAK, getNormalZombieDeid());
        animeMap.put(AnimeType.ATTACK,getAttackAnime());


        setAnimeMap(animeMap);

    }

    public Anime getAttackAnime() {
        String src = "res/img/zombiePng/NormalZombie/attack";

        int starIndex = 0;
        int endIndex = 20;

        return Util.createAnime(src, "Attack", starIndex, endIndex, -1);
    }


}
